Optimal. Leaf size=167 \[ \frac{i B \tan ^{m+1}(c+d x) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n \text{Hypergeometric2F1}(m+1,1-n,m+2,-i \tan (c+d x))}{d (m+1)}+\frac{(A-i B) \tan ^{m+1}(c+d x) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n F_1(m+1;1-n,1;m+2;-i \tan (c+d x),i \tan (c+d x))}{d (m+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.30397, antiderivative size = 167, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.206, Rules used = {3601, 3564, 135, 133, 3599, 66, 64} \[ \frac{(A-i B) \tan ^{m+1}(c+d x) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n F_1(m+1;1-n,1;m+2;-i \tan (c+d x),i \tan (c+d x))}{d (m+1)}+\frac{i B \tan ^{m+1}(c+d x) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n \, _2F_1(m+1,1-n;m+2;-i \tan (c+d x))}{d (m+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3601
Rule 3564
Rule 135
Rule 133
Rule 3599
Rule 66
Rule 64
Rubi steps
\begin{align*} \int \tan ^m(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx &=-\left ((-A+i B) \int \tan ^m(c+d x) (a+i a \tan (c+d x))^n \, dx\right )+\frac{(i B) \int \tan ^m(c+d x) (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^n \, dx}{a}\\ &=\frac{(i a B) \operatorname{Subst}\left (\int x^m (a+i a x)^{-1+n} \, dx,x,\tan (c+d x)\right )}{d}+\frac{\left (a^2 (i A+B)\right ) \operatorname{Subst}\left (\int \frac{\left (-\frac{i x}{a}\right )^m (a+x)^{-1+n}}{-a^2+a x} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=\frac{\left (i B (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n\right ) \operatorname{Subst}\left (\int (1+i x)^{-1+n} x^m \, dx,x,\tan (c+d x)\right )}{d}+\frac{\left (a (i A+B) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n\right ) \operatorname{Subst}\left (\int \frac{\left (-\frac{i x}{a}\right )^m \left (1+\frac{x}{a}\right )^{-1+n}}{-a^2+a x} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=\frac{(A-i B) F_1(1+m;1-n,1;2+m;-i \tan (c+d x),i \tan (c+d x)) (1+i \tan (c+d x))^{-n} \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^n}{d (1+m)}+\frac{i B \, _2F_1(1+m,1-n;2+m;-i \tan (c+d x)) (1+i \tan (c+d x))^{-n} \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^n}{d (1+m)}\\ \end{align*}
Mathematica [F] time = 18.1913, size = 0, normalized size = 0. \[ \int \tan ^m(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 184.135, size = 0, normalized size = 0. \begin{align*} \int \left ( \tan \left ( dx+c \right ) \right ) ^{m} \left ( a+ia\tan \left ( dx+c \right ) \right ) ^{n} \left ( A+B\tan \left ( dx+c \right ) \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \tan \left (d x + c\right )^{m}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left ({\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + A + i \, B\right )} \left (\frac{2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n} \left (\frac{-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{m}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \tan \left (d x + c\right )^{m}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]